package com.k7.mobile.platform.dao.impl;

import java.util.List;

import com.k7.mobile.platform.dao.IRankingDAO;
import com.k7.mobile.platform.dataobject.GramDO;
import com.k7.mobile.platform.dataobject.RankingDO;


public class RankingDAOImpl extends BaseDAOImpl implements IRankingDAO{

	@Override
	public Long add(RankingDO rankingDO) {
		
		Object id = getSqlMapClientTemplate().insert("RANKING-ADD", rankingDO);
		return (Long) id;
	}
	
	@Override
	public void delete(RankingDO rankingDO) {
		
		this.getSqlMapClientTemplate().delete("RANKING-DEL", rankingDO);
		
	}

	@Override
	public void update(RankingDO rankingDO) {
		
		this.getSqlMapClientTemplate().update("RANKING-UPDATE", rankingDO);
		
	}

	@Override
	public List<RankingDO> findList(RankingDO rankingDO) {
		
		return this.executeQueryForList("FIND-RANKING-LIST","FIND-RANKING-LIST-COUNT",  rankingDO);
	}

	@Override
	public RankingDO getRanking(RankingDO rankingDO) {
		return (RankingDO) this.getSqlMapClientTemplate().queryForObject("GET-RANKING", rankingDO);
	}
}
